﻿using System;
using System.Collections.Generic;
using System.Text;
using Pixysoft.Framework.Security.Entity;

namespace Pixysoft.Framework.Security.Controller
{
    class AppAuthController
    {
        private static volatile AppAuthController instance;

        private static object syncRoot = new Object();

        public static AppAuthController Instance
        {
            get
            {
                if (instance == null)
                {
                    lock (syncRoot)
                    {
                        if (instance == null)
                        {
                            instance = new AppAuthController();
                        }
                    }
                }
                return instance;
            }
        }

        private User loginUser = null;




        public void RemoveUser()
        {
            this.loginUser = null;
        }
        
        public void AddUser(User user)
        {
            this.loginUser = user;
        }

        public User GetUser()
        {
            return loginUser;
        }
    }
}
